3.2.29 \(\int \frac {\cos ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx\) [129]

3.2.29.1 Optimal result
3.2.29.2 Mathematica [A] (verified)
3.2.29.3 Rubi [A] (verified)
3.2.29.4 Maple [A] (verified)
3.2.29.5 Fricas [A] (verification not implemented)
3.2.29.6 Sympy [B] (verification not implemented)
3.2.29.7 Maxima [F(-2)]
3.2.29.8 Giac [B] (verification not implemented)
3.2.29.9 Mupad [B] (verification not implemented)

3.2.29.1 Optimal result

Integrand size = 24, antiderivative size = 107 \[ \int \frac {\cos ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {7 \sin (c+d x)}{9 a^2 d}-\frac {7 \sin ^3(c+d x)}{9 a^2 d}+\frac {7 \sin ^5(c+d x)}{15 a^2 d}-\frac {\sin ^7(c+d x)}{9 a^2 d}+\frac {2 i \cos ^7(c+d x)}{9 d \left (a^2+i a^2 \tan (c+d x)\right )} \]

output
7/9*sin(d*x+c)/a^2/d-7/9*sin(d*x+c)^3/a^2/d+7/15*sin(d*x+c)^5/a^2/d-1/9*si 
n(d*x+c)^7/a^2/d+2/9*I*cos(d*x+c)^7/d/(a^2+I*a^2*tan(d*x+c))
 
3.2.29.2 Mathematica [A] (verified)

Time = 0.85 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.09 \[ \int \frac {\cos ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {i \sec ^2(c+d x) (-1050 \cos (c+d x)+378 \cos (3 (c+d x))+30 \cos (5 (c+d x))+2 \cos (7 (c+d x))-525 i \sin (c+d x)+567 i \sin (3 (c+d x))+75 i \sin (5 (c+d x))+7 i \sin (7 (c+d x)))}{2880 a^2 d (-i+\tan (c+d x))^2} \]

input
Integrate[Cos[c + d*x]^5/(a + I*a*Tan[c + d*x])^2,x]
 
output
((I/2880)*Sec[c + d*x]^2*(-1050*Cos[c + d*x] + 378*Cos[3*(c + d*x)] + 30*C 
os[5*(c + d*x)] + 2*Cos[7*(c + d*x)] - (525*I)*Sin[c + d*x] + (567*I)*Sin[ 
3*(c + d*x)] + (75*I)*Sin[5*(c + d*x)] + (7*I)*Sin[7*(c + d*x)]))/(a^2*d*( 
-I + Tan[c + d*x])^2)
 
3.2.29.3 Rubi [A] (verified)

Time = 0.32 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.82, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.208, Rules used = {3042, 3981, 3042, 3113, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\cos ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sec (c+d x)^5 (a+i a \tan (c+d x))^2}dx\)

\(\Big \downarrow \) 3981

\(\displaystyle \frac {7 \int \cos ^7(c+d x)dx}{9 a^2}+\frac {2 i \cos ^7(c+d x)}{9 d \left (a^2+i a^2 \tan (c+d x)\right )}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {7 \int \sin \left (c+d x+\frac {\pi }{2}\right )^7dx}{9 a^2}+\frac {2 i \cos ^7(c+d x)}{9 d \left (a^2+i a^2 \tan (c+d x)\right )}\)

\(\Big \downarrow \) 3113

\(\displaystyle -\frac {7 \int \left (-\sin ^6(c+d x)+3 \sin ^4(c+d x)-3 \sin ^2(c+d x)+1\right )d(-\sin (c+d x))}{9 a^2 d}+\frac {2 i \cos ^7(c+d x)}{9 d \left (a^2+i a^2 \tan (c+d x)\right )}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {7 \left (\frac {1}{7} \sin ^7(c+d x)-\frac {3}{5} \sin ^5(c+d x)+\sin ^3(c+d x)-\sin (c+d x)\right )}{9 a^2 d}+\frac {2 i \cos ^7(c+d x)}{9 d \left (a^2+i a^2 \tan (c+d x)\right )}\)

input
Int[Cos[c + d*x]^5/(a + I*a*Tan[c + d*x])^2,x]
 
output
(-7*(-Sin[c + d*x] + Sin[c + d*x]^3 - (3*Sin[c + d*x]^5)/5 + Sin[c + d*x]^ 
7/7))/(9*a^2*d) + (((2*I)/9)*Cos[c + d*x]^7)/(d*(a^2 + I*a^2*Tan[c + d*x]) 
)
 

3.2.29.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3113
Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
and[(1 - x^2)^((n - 1)/2), x], x], x, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] 
 && IGtQ[(n - 1)/2, 0]
 

rule 3981
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x 
_)])^(n_), x_Symbol] :> Simp[2*d^2*(d*Sec[e + f*x])^(m - 2)*((a + b*Tan[e + 
 f*x])^(n + 1)/(b*f*(m + 2*n))), x] - Simp[d^2*((m - 2)/(b^2*(m + 2*n))) 
Int[(d*Sec[e + f*x])^(m - 2)*(a + b*Tan[e + f*x])^(n + 2), x], x] /; FreeQ[ 
{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] && LtQ[n, -1] && ((ILtQ[n/2, 0] 
 && IGtQ[m - 1/2, 0]) || EqQ[n, -2] || IGtQ[m + n, 0] || (IntegersQ[n, m + 
1/2] && GtQ[2*m + n + 1, 0])) && IntegerQ[2*m]
 
3.2.29.4 Maple [A] (verified)

Time = 0.70 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.28

method result size
risch \(\frac {i {\mathrm e}^{-7 i \left (d x +c \right )}}{128 a^{2} d}+\frac {i {\mathrm e}^{-9 i \left (d x +c \right )}}{1152 a^{2} d}+\frac {7 i \cos \left (d x +c \right )}{64 a^{2} d}+\frac {7 \sin \left (d x +c \right )}{16 a^{2} d}+\frac {i \cos \left (5 d x +5 c \right )}{32 a^{2} d}+\frac {11 \sin \left (5 d x +5 c \right )}{320 a^{2} d}+\frac {7 i \cos \left (3 d x +3 c \right )}{96 a^{2} d}+\frac {7 \sin \left (3 d x +3 c \right )}{64 a^{2} d}\) \(137\)
derivativedivides \(\frac {\frac {i}{8 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{4}}-\frac {9 i}{32 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{2}}+\frac {1}{20 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{5}}-\frac {13}{48 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{3}}+\frac {29}{64 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )}-\frac {2 i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{8}}+\frac {51 i}{16 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {49 i}{6 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{6}}-\frac {35 i}{4 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {4}{9 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{9}}-\frac {5}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{7}}+\frac {49}{5 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}-\frac {49}{8 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {99}{64 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}}{a^{2} d}\) \(240\)
default \(\frac {\frac {i}{8 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{4}}-\frac {9 i}{32 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{2}}+\frac {1}{20 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{5}}-\frac {13}{48 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )^{3}}+\frac {29}{64 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+i\right )}-\frac {2 i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{8}}+\frac {51 i}{16 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {49 i}{6 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{6}}-\frac {35 i}{4 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {4}{9 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{9}}-\frac {5}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{7}}+\frac {49}{5 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}-\frac {49}{8 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {99}{64 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}}{a^{2} d}\) \(240\)

input
int(cos(d*x+c)^5/(a+I*a*tan(d*x+c))^2,x,method=_RETURNVERBOSE)
 
output
1/128*I/a^2/d*exp(-7*I*(d*x+c))+1/1152*I/a^2/d*exp(-9*I*(d*x+c))+7/64*I/a^ 
2/d*cos(d*x+c)+7/16*sin(d*x+c)/a^2/d+1/32*I/a^2/d*cos(5*d*x+5*c)+11/320/a^ 
2/d*sin(5*d*x+5*c)+7/96*I/a^2/d*cos(3*d*x+3*c)+7/64/a^2/d*sin(3*d*x+3*c)
 
3.2.29.5 Fricas [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.90 \[ \int \frac {\cos ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {{\left (-9 i \, e^{\left (14 i \, d x + 14 i \, c\right )} - 105 i \, e^{\left (12 i \, d x + 12 i \, c\right )} - 945 i \, e^{\left (10 i \, d x + 10 i \, c\right )} + 1575 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 525 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 189 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 45 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 5 i\right )} e^{\left (-9 i \, d x - 9 i \, c\right )}}{5760 \, a^{2} d} \]

input
integrate(cos(d*x+c)^5/(a+I*a*tan(d*x+c))^2,x, algorithm="fricas")
 
output
1/5760*(-9*I*e^(14*I*d*x + 14*I*c) - 105*I*e^(12*I*d*x + 12*I*c) - 945*I*e 
^(10*I*d*x + 10*I*c) + 1575*I*e^(8*I*d*x + 8*I*c) + 525*I*e^(6*I*d*x + 6*I 
*c) + 189*I*e^(4*I*d*x + 4*I*c) + 45*I*e^(2*I*d*x + 2*I*c) + 5*I)*e^(-9*I* 
d*x - 9*I*c)/(a^2*d)
 
3.2.29.6 Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 299 vs. \(2 (94) = 188\).

Time = 0.40 (sec) , antiderivative size = 299, normalized size of antiderivative = 2.79 \[ \int \frac {\cos ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\begin {cases} \frac {\left (- 227994731135631360 i a^{14} d^{7} e^{30 i c} e^{5 i d x} - 2659938529915699200 i a^{14} d^{7} e^{28 i c} e^{3 i d x} - 23939446769241292800 i a^{14} d^{7} e^{26 i c} e^{i d x} + 39899077948735488000 i a^{14} d^{7} e^{24 i c} e^{- i d x} + 13299692649578496000 i a^{14} d^{7} e^{22 i c} e^{- 3 i d x} + 4787889353848258560 i a^{14} d^{7} e^{20 i c} e^{- 5 i d x} + 1139973655678156800 i a^{14} d^{7} e^{18 i c} e^{- 7 i d x} + 126663739519795200 i a^{14} d^{7} e^{16 i c} e^{- 9 i d x}\right ) e^{- 25 i c}}{145916627926804070400 a^{16} d^{8}} & \text {for}\: a^{16} d^{8} e^{25 i c} \neq 0 \\\frac {x \left (e^{14 i c} + 7 e^{12 i c} + 21 e^{10 i c} + 35 e^{8 i c} + 35 e^{6 i c} + 21 e^{4 i c} + 7 e^{2 i c} + 1\right ) e^{- 9 i c}}{128 a^{2}} & \text {otherwise} \end {cases} \]

input
integrate(cos(d*x+c)**5/(a+I*a*tan(d*x+c))**2,x)
 
output
Piecewise(((-227994731135631360*I*a**14*d**7*exp(30*I*c)*exp(5*I*d*x) - 26 
59938529915699200*I*a**14*d**7*exp(28*I*c)*exp(3*I*d*x) - 2393944676924129 
2800*I*a**14*d**7*exp(26*I*c)*exp(I*d*x) + 39899077948735488000*I*a**14*d* 
*7*exp(24*I*c)*exp(-I*d*x) + 13299692649578496000*I*a**14*d**7*exp(22*I*c) 
*exp(-3*I*d*x) + 4787889353848258560*I*a**14*d**7*exp(20*I*c)*exp(-5*I*d*x 
) + 1139973655678156800*I*a**14*d**7*exp(18*I*c)*exp(-7*I*d*x) + 126663739 
519795200*I*a**14*d**7*exp(16*I*c)*exp(-9*I*d*x))*exp(-25*I*c)/(1459166279 
26804070400*a**16*d**8), Ne(a**16*d**8*exp(25*I*c), 0)), (x*(exp(14*I*c) + 
 7*exp(12*I*c) + 21*exp(10*I*c) + 35*exp(8*I*c) + 35*exp(6*I*c) + 21*exp(4 
*I*c) + 7*exp(2*I*c) + 1)*exp(-9*I*c)/(128*a**2), True))
 
3.2.29.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {\cos ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\text {Exception raised: RuntimeError} \]

input
integrate(cos(d*x+c)^5/(a+I*a*tan(d*x+c))^2,x, algorithm="maxima")
 
output
Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negati 
ve exponent.
 
3.2.29.8 Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 197 vs. \(2 (93) = 186\).

Time = 0.49 (sec) , antiderivative size = 197, normalized size of antiderivative = 1.84 \[ \int \frac {\cos ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {\frac {3 \, {\left (435 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 1470 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2060 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1330 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 353\right )}}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right )}^{5}} + \frac {4455 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 26460 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 78120 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 137340 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 157374 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 118356 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 57744 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 16596 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2339}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}^{9}}}{2880 \, d} \]

input
integrate(cos(d*x+c)^5/(a+I*a*tan(d*x+c))^2,x, algorithm="giac")
 
output
1/2880*(3*(435*tan(1/2*d*x + 1/2*c)^4 + 1470*I*tan(1/2*d*x + 1/2*c)^3 - 20 
60*tan(1/2*d*x + 1/2*c)^2 - 1330*I*tan(1/2*d*x + 1/2*c) + 353)/(a^2*(tan(1 
/2*d*x + 1/2*c) + I)^5) + (4455*tan(1/2*d*x + 1/2*c)^8 - 26460*I*tan(1/2*d 
*x + 1/2*c)^7 - 78120*tan(1/2*d*x + 1/2*c)^6 + 137340*I*tan(1/2*d*x + 1/2* 
c)^5 + 157374*tan(1/2*d*x + 1/2*c)^4 - 118356*I*tan(1/2*d*x + 1/2*c)^3 - 5 
7744*tan(1/2*d*x + 1/2*c)^2 + 16596*I*tan(1/2*d*x + 1/2*c) + 2339)/(a^2*(t 
an(1/2*d*x + 1/2*c) - I)^9))/d
 
3.2.29.9 Mupad [B] (verification not implemented)

Time = 6.54 (sec) , antiderivative size = 216, normalized size of antiderivative = 2.02 \[ \int \frac {\cos ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {191\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16}-\frac {1289\,\sin \left (\frac {3\,c}{2}+\frac {3\,d\,x}{2}\right )}{64}+\frac {649\,\sin \left (\frac {5\,c}{2}+\frac {5\,d\,x}{2}\right )}{64}-\frac {41\,\sin \left (\frac {7\,c}{2}+\frac {7\,d\,x}{2}\right )}{32}+\frac {41\,\sin \left (\frac {9\,c}{2}+\frac {9\,d\,x}{2}\right )}{32}-\frac {7\,\sin \left (\frac {11\,c}{2}+\frac {11\,d\,x}{2}\right )}{64}+\frac {7\,\sin \left (\frac {13\,c}{2}+\frac {13\,d\,x}{2}\right )}{64}+\frac {\cos \left (\frac {3\,c}{2}+\frac {3\,d\,x}{2}\right )\,525{}\mathrm {i}}{32}-\frac {\cos \left (\frac {5\,c}{2}+\frac {5\,d\,x}{2}\right )\,205{}\mathrm {i}}{32}+\frac {\cos \left (\frac {7\,c}{2}+\frac {7\,d\,x}{2}\right )\,1{}\mathrm {i}}{2}-\frac {\cos \left (\frac {9\,c}{2}+\frac {9\,d\,x}{2}\right )\,1{}\mathrm {i}}{2}+\frac {\cos \left (\frac {11\,c}{2}+\frac {11\,d\,x}{2}\right )\,1{}\mathrm {i}}{32}-\frac {\cos \left (\frac {13\,c}{2}+\frac {13\,d\,x}{2}\right )\,1{}\mathrm {i}}{32}\right )\,2{}\mathrm {i}}{45\,a^2\,d\,{\left (\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}\right )}^9\,{\left (\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}\right )}^5} \]

input
int(cos(c + d*x)^5/(a + a*tan(c + d*x)*1i)^2,x)
 
output
(cos(c/2 + (d*x)/2)*((cos((3*c)/2 + (3*d*x)/2)*525i)/32 - (cos((5*c)/2 + ( 
5*d*x)/2)*205i)/32 + (cos((7*c)/2 + (7*d*x)/2)*1i)/2 - (cos((9*c)/2 + (9*d 
*x)/2)*1i)/2 + (cos((11*c)/2 + (11*d*x)/2)*1i)/32 - (cos((13*c)/2 + (13*d* 
x)/2)*1i)/32 + (191*sin(c/2 + (d*x)/2))/16 - (1289*sin((3*c)/2 + (3*d*x)/2 
))/64 + (649*sin((5*c)/2 + (5*d*x)/2))/64 - (41*sin((7*c)/2 + (7*d*x)/2))/ 
32 + (41*sin((9*c)/2 + (9*d*x)/2))/32 - (7*sin((11*c)/2 + (11*d*x)/2))/64 
+ (7*sin((13*c)/2 + (13*d*x)/2))/64)*2i)/(45*a^2*d*(cos(c/2 + (d*x)/2) + s 
in(c/2 + (d*x)/2)*1i)^9*(cos(c/2 + (d*x)/2)*1i + sin(c/2 + (d*x)/2))^5)